package com.platform.sms;

import java.util.Date;

/**
 * @Description: java类作用描述
 * @Author: jf2
 * @CreateDate: 2018/5/25 0025 11:11
 * @Version: 1.0
 * Copyright: Copyright (c) 2018
 **/
public abstract class SmsSendService {

    /**
     * 短信配置
     */
    SmsSendConfig smsSendConfig;


    /**
     * 检查配置是否正确
     * @return
     */
    public abstract void checkConfig();

    /**
     * 调用短信发送接口
     * @param mobile
     * @param content
     * @param stime
     * @param extno
     * @return
     */
    public abstract String sendPost(String mobile,String content,Date stime,String extno);

    /**
     * 发送结果解析
     * @param result
     * @return
     */
    public abstract boolean resultParse(String result);

    /**
     * 短信发送
     * @param mobile
     * @param content
     * @param stime
     * @param extno
     * @return
     */
    public boolean send(String mobile,String content,Date stime,String extno){
        checkConfig();
        String result = sendPost( mobile, content, stime, extno);
        return resultParse(result);
    }
}
